import config from "@/config"
import http from "@/utils/request"

export default {
	online: {
		list: {
			url: `${config.API_URL}/system/online/list`,
			name: "在线用户",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		forceLogout: {
			url: `${config.API_URL}/system/online/`,
			name: "强退用户",
			delete: async function(tokenId){
				return await http.delete(this.url + tokenId);
			}
		},
	},
	server: {
		getServer: {
			url: `${config.API_URL}/system/monitor/server`,
			name: "服务监控",
			get: async function(){
				return await http.get(this.url);
			}
		},
	},
	cache: {
		getCache: {
			url: `${config.API_URL}/system/monitor/cache`,
			name: "查询缓存",
			get: async function(){
				return await http.get(this.url);
			}
		},
		listCacheName: {
			url: `${config.API_URL}/system/monitor/cache/listCacheName`,
			name: "查询缓存",
			get: async function(){
				return await http.get(this.url);
			}
		},
		listCacheKey: {
			url: `${config.API_URL}/system/monitor/cache/listCacheKey/`,
			name: "查询缓存",
			get: async function(cacheId){
				return await http.get(this.url + cacheId);
			}
		},
		clearCache: {
			url: `${config.API_URL}/system/monitor/cache/clearCache/`,
			name: "删除缓存",
			delete: async function(cacheId){
				return await http.delete(this.url + cacheId);
			}
		},
		clearCacheByKey: {
			url: `${config.API_URL}/system/monitor/cache/clearCacheByKey/`,
			name: "删除缓存",
			delete: async function(cacheKey){
				return await http.delete(this.url + cacheKey);
			}
		},
	},
	workflow:{
		list: {
			url: `${config.API_URL}/workflow/process/monitor`,
			name: "查询流程监控列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
	},
	dbConn: {
		listConnect: {
			url: `${config.API_URL}/system/connect/list`,
			name: "查询数据连接列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		changeSort: {
			url: `${config.API_URL}/system/connect/changeOrder`,
			name: "数据连接排序",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		getConnect: {
			url: `${config.API_URL}/system/connect/`,
			name: "查询数据连接详细",
			get: async function(connId){
				return await http.get(this.url + connId);
			}
		},
		testConnect: {
			url: `${config.API_URL}/system/connect/test`,
			name: "测试数据连接",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		addConnect: {
			url: `${config.API_URL}/system/connect`,
			name: "增加数据连接",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		updateConnect: {
			url: `${config.API_URL}/system/connect`,
			name: "修改数据连接",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		delConnect: {
			url: `${config.API_URL}/system/connect/`,
			name: "删除数据连接",
			delete: async function(connId){
				return await http.delete(this.url + connId);
			}
		},
		getTables: {
			url: `${config.API_URL}/system/connect/tables?id=`,
			name: "查询数据表",
			get: async function(id){
				return await http.get(this.url + id);
			}
		},
		getConnects: {
			url: `${config.API_URL}/system/connect/connects`,
			name: "查询数据表",
			get: async function(){
				return await http.get(this.url);
			}
		},
		getFields: {
			url: `${config.API_URL}/system/connect/fields?`,
			name: "查询字段信息",
			get: async function(id,tableName){
				return await http.get(this.url + 'id='+id+"&tableName="+tableName);
			}
		},
		createdTable: {
			url: `${config.API_URL}/system/connect/table/create/`,
			name: "创建数据表",
			post: async function(id,data){
				return await http.post(this.url + id, data);
			}
		},
		getTableByName: {
			url: `${config.API_URL}/system/connect/tables/`,
			name: "查询数据表",
			get: async function(id,name){
				return await http.get(this.url + id +"?name="+name);
			}
		},
		listData: {
			url: `${config.API_URL}/system/connect/data/tables`,
			name: "查询数据表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		delTable: {
			url: `${config.API_URL}/system/connect/table?`,
			name: "删除数据表",
			delete: async function(connId,table){
				return await http.delete(this.url + 'connectId='+connId+"&tableName="+table);
			}
		},
		changeStatus: {
			url: `${config.API_URL}/system/connect/status/`,
			name: "修改数据连接状态",
			put: async function(id){
				return await http.put(this.url+id);
			}
		}
	},
	interface: {
		list: {
			url: `${config.API_URL}/system/interface/list`,
			name: "查询数据列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		getDetailByAppId:{
			url: `${config.API_URL}/system/interface/app/`,
			name: "根据APPID查询数据接口详细",
			get: async function(id){
				return await http.get(this.url + id);
			}
		},
		get: {
			url: `${config.API_URL}/system/interface/`,
			name: "查询数据接口详细",
			get: async function(id){
				return await http.get(this.url + id);
			}
		},
		getDetails: {
			url: `${config.API_URL}/system/interface/interfaces`,
			name: "查询数据接口详细",
			get: async function(){
				return await http.get(this.url);
			}
		},
		getDetail: {
			url: `${config.API_URL}/system/interface/interfaces/`,
			name: "查询数据接口详细",
			get: async function(id){
				return await http.get(this.url + id);
			}
		},
		add: {
			url: `${config.API_URL}/system/interface`,
			name: "新增数据接口",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		update: {
			url: `${config.API_URL}/system/interface`,
			name: "修改数据接口",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		del: {
			url: `${config.API_URL}/system/interface/`,
			name: "删除数据接口",
			delete: async function(id){
				return await http.delete(this.url + id);
			}
		},
		getParams: {
			url: `${config.API_URL}/system/interface/params/`,
			name: "查询数据接口列表",
			get: async function(id){
				return await http.get(this.url + id);
			}
		},
		test: {
			url: `${config.API_URL}/system/interface/response/`,
			name: "接口测试",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		addGroup: {
			url: `${config.API_URL}/system/group/add`,
			name: "新增数据接口分组",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		getGroupList: {
			url: `${config.API_URL}/system/group/list`,
			name: "获取数据接口分组列表",
			get: async function(){
				return await http.get(this.url, null);
			}
		},
	},
	model:{
		list: {
			url: `${config.API_URL}/system/model/list`,
			name: "查询模型列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		get: {
			url: `${config.API_URL}/system/model/`,
			name: "查询模型详细",
			get: async function(id){
				return await http.get(this.url + id);
			}
		},
		saveDataModel:{
			url: `${config.API_URL}/system/model`,
			name: "保存模型",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		update: {
			url: `${config.API_URL}/system/model`,
			name: "修改模型接口",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		del: {
			url: `${config.API_URL}/system/model/`,
			name: "删除模型接口",
			delete: async function(id){
				return await http.delete(this.url + id);
			}
		},
		changeSort:{
			url: `${config.API_URL}/system/model/sort`,
			name: "修改模型排序",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		userModes: {
			url: `${config.API_URL}/system/model/user/modes`,
			name: "查询模型列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},

	},
	form:{
		list: {
			url: `${config.API_URL}/workflow/form/list`,
			name: "查询表单列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		del: {
			url: `${config.API_URL}/workflow/form/`,
			name: "删除表单接口",
			delete: async function(id){
				return await http.delete(this.url + id);
			}
		},
		getFormByAppId: {
			url: `${config.API_URL}/workflow/form/app/`,
			name: "根据应用Id和类型查询表单模型",
			get: async function(id,type){
				return await http.get(this.url + id+ "/" +type);
			}
		},
		addForm:{
			url: `${config.API_URL}/workflow/form`,
			name: "保存流程表单模型",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		updateForm:{
			url: `${config.API_URL}/workflow/form`,
			name: "修改流程表单模型",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		changeStatus:{
			url: `${config.API_URL}/workflow/form/status`,
			name: "修改流程表单状态",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		getDetails: {
			url: `${config.API_URL}/workflow/form/`,
			name: "查询数据接口详细",
			get: async function(id){
				return await http.get(this.url+id);
			}
		},
	},
	flow:{
		getListByAppId: {
			url: `${config.API_URL}/workflow/version/app/`,
			name: "查询表单列表",
			get: async function(appId){
				return await http.get(this.url+ appId);
			}
		},
		addFlow:{
			url: `${config.API_URL}/workflow/version/`,
			name: "保存流程模型",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		updateFlow:{
			url: `${config.API_URL}/workflow/version/`,
			name: "保存流程模型",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
		updateDefaultFlow:{
			url: `${config.API_URL}/workflow/version/default`,
			name: "修改默认流程模型",
			put: async function(data){
				return await http.put(this.url, data);
			}
		},
	},
	roleGroup:{
		list: {
			url: `${config.API_URL}/system/role/group/list`,
			name: "根据应用ID查询角色组列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
	}















}
